import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
// import App from './App'
// import App from './componments/app/App.jsx'
// react-router demo
// import App from './app/app-router.jsx'

import { BrowserRouter } from 'react-router-dom'

// import App from './app/app-router.jsx'
// import App from './app/app-ant-ui.jsx'
// import App from './app/app-counter-redux.jsx'
import App from './containers/app-counter-redux'
import 'antd-mobile/dist/antd-mobile.css' // or 'antd-mobile/dist/antd-mobile.less'
import * as serviceWorker from './serviceWorker'
// import { createStore } from 'redux'
// import { counter } from './redux/reducers.jsx'
// const store = createStore(counter) // 此处要接受一个reducer 对象

import store from './redux/store'

import { Provider } from 'react-redux'

function render() {
  ReactDOM.render(
    <React.StrictMode>
      <BrowserRouter>
        <Provider store={store}>
          <App />
        </Provider>
      </BrowserRouter>{' '}
    </React.StrictMode>,

    document.getElementById('root'),
  )
}
// 初始化渲染
render()
store.subscribe(render)

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister()
